package sgt.onlinetest.hibernatedao;

import org.hibernate.Session;
import org.hibernate.criterion.Expression;
import sgt.onlinetest.entity.User;

public class HibernateUserDAO extends HibernateGenericDAO<User, Long> {

    public HibernateUserDAO(Session session) {
        super(session);
    }

    public User getByUsername(String username) {
        return (User) getSession().createCriteria(User.class).add(Expression.eq("username", username)).uniqueResult();
    }
}
